﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace BT.UI
{
    public class TextureList
    {

        public Texture2D Texture { get; private set; }

        public int FrameCount { get; private set; }

        public Rectangle[] Rectangles { get; private set; }

        public TextureList(Texture2D texture, int frameCount)
        {
            Texture = texture;
            FrameCount = frameCount;
            Rectangles = new Rectangle[frameCount];

            int width = Texture.Bounds.Width / frameCount;

            for (int i = 0; i < frameCount; i++)
                Rectangles[i] = new Rectangle(i * width, 0, width, texture.Bounds.Height);
        }

    }
}
